The coefficient of determination is a statistical measure used to examine how differences in one variable are explained by differences in another variable, especially when predicting the outcome of a specific event.
The coefficient of determination is a statistical measure used to examine how differences in one variable are explained by differences in another variable, especially when predicting the outcome of a specific event. This coefficient is more commonly known as r-squared (or r²). It evaluates the strength of the linear relationship between two variables and is widely relied upon by investors when conducting trend analysis.
This coefficient usually answers a key question: If a stock is listed in an index and experiences price fluctuations, what percentage of its price fluctuations is caused by the price fluctuations in the index?
The coefficient of determination is a measure that explains how much of the variability in one factor is due to its relationship to another factor. This correlation is represented by a value from 0.0 to 1.0 or 0% to 100%.
A value of 1.0 indicates 100% price correlation and is a reliable model for future forecasts. A value of 0.0 implies that the model shows that the price does not depend on the index. [1]
A value of 0.20 indicates that 20% of the asset's price fluctuations can be explained by the index; a value of 0.50 indicates that 50% of the price fluctuations can be explained.
IMPORTANT NOTE: The coefficient of determination is the square of the correlation coefficient, which is usually represented by "r" in statistics. The value "r" can be negative, but r² cannot be negative, because r-squared is the result of "r" multiplied by itself, and the negative of the square is always positive. [2]
The coefficient of determination is calculated by creating a scatter plot and trend line of the data.
If you were to plot the closing prices of the S&P 500 and Apple (AAPL) stock for the trading days from December 21st to January 20th, you would collect the prices in the table below. [3]4
| S&P daily closing | APPL daily closing | |
|---|---|---|
| January 20 |
137.87 |19|
<!-- @@@ -->135.27 |18|
<!-- @@@ -->135.21 |17|
<!-- @@@ -->135.94 |13|
<!-- @@@ -->134.76 |12|
<!-- @@@ -->133.41 |11|
<!-- @@@ -->133.49 |10|
<!-- @@@ -->130.73 |9|
<!-- @@@ -->130.15 |6|
<!-- @@@ -->129.62 |5|
<!-- @@@ -->125.02 |4|
<!-- @@@ -->126.36 |3|
<!-- @@@ -->125.07 |December 30|
<!-- @@@ -->139.93 |29|
<!-- @@@ -->129.61 |28|
<!-- @@@ -->126.04 |27|
<!-- @@@ -->130.03 |23|
<!-- @@@ -->131.86 |22|
<!-- @@@ -->132.23 |21|
<!-- @@@ -->135.45
Next, you'll create a scatter plot. How well the data fits the regression model is called goodness of fit, which measures the distance between the trend line and all the data points scattered across the graph.
Most spreadsheets use the same formula to calculate r² for a data set. If the data is in columns A and B of your table:
Using this formula and highlighting the corresponding cells, the r² for the S&P 500 and Apple prices is 0.347, which indicates that the two are less correlated, whereas if r² is between 0.5 and 1.0, the correlation is higher.
Manually calculating the coefficient of determination involves several steps. First, collect the data in the above table and then calculate all the required values as shown in the table below: [4]
| x | x² | y | y² | xy | |
|---|---|---|---|---|---|
| January 20 |
15,781,630.21|
<!-- @@@ -->19,008.14|
<!-- @@@ -->3,898.85|
<!-- @@@ -->135.27|
<!-- @@@ -->527,397.44 |18|
<!-- @@@ -->15,435,940.90|
<!-- @@@ -->18,281.74|
<!-- @@@ -->3,990.97|
<!-- @@@ -->135.94|
<!-- @@@ -->542,532.46 |13|
<!-- @@@ -->15,992,720.83|
<!-- @@@ -->18,160.26|
<!-- @@@ -->3,983.17|
<!-- @@@ -->133.41|
<!-- @@@ -->531,394.71 |11|
<!-- @@@ -->15,757,803.55|
<!-- @@@ -->17,819.58|
<!-- @@@ -->3,919.25|
<!-- @@@ -->130.73|
<!-- @@@ -->512,363.55 |9|
<!-- @@@ -->15,148,364.57|
<!-- @@@ -->16,939.02|
<!-- @@@ -->3,895.08|
<!-- @@@ -->129.62|
<!-- @@@ -->504,880.27 |5|
<!-- @@@ -->14,501,625.61|
<!-- @@@ -->15,630.00|
<!-- @@@ -->3,852.97|
<!-- @@@ -->126.36|
<!-- @@@ -->486,861.29 |3|
<!-- @@@ -->14,624,046.74|
<!-- @@@ -->15,642.50|
<!-- @@@ -->3,839.50|
<!-- @@@ -->139.93|
<!-- @@@ -->537,261.24 |29|
<!-- @@@ -->14,816,956.52|
<!-- @@@ -->16,798.75|
<!-- @@@ -->3,783.22|
<!-- @@@ -->126.04|
<!-- @@@ -->476,837.05 |27|
<!-- @@@ -->14,663,155.56|
<!-- @@@ -->16,907.80|
<!-- @@@ -->3,844.82|
<!-- @@@ -->131.86|
<!-- @@@ -->506,977.97 |22|
<!-- @@@ -->14,610,665.31|
<!-- @@@ -->17,484.77|
<!-- @@@ -->3,878.44|
<!-- @@@ -->135.45|
<!-- @@@ -->525,334.70 |Sum (Σ)|
<!-- @@@ -->302,584,424.00|
<!-- @@@ -->348,307.23|$10,262,772.73
Use this formula and replace the values in each row of the table, where n equals the number of samples. In this case it's 20:
<!-- @@@ -->where √ represents the square root of the result in parentheses.
<!-- @@@ -->Now get:
<!-- @@@ -->Now multiply steps two and three, divide step one by the result, and square it:
<!-- @@@ -->As you can see, this can become very tedious and error-prone when processing several weeks' worth of transaction data.
When you have the coefficient of determination, you can use it to evaluate how closely the price movements of the asset you are evaluating are related to the price movements of an index or benchmark. In the case of Apple versus the S&P 500, the coefficient of determination for that period is 0.347.
TIP: Apple is listed on many indexes, so you can calculate r² to determine if it corresponds to price movements in other indexes.
A coefficient of determination of 0.357 indicates that Apple stock price movements are somewhat correlated with the index, as 1.0 indicates a high correlation and 0.0 indicates no correlation.
One thing to note is that r-squared does not tell the analyst whether the value of the coefficient of determination is inherently good or bad. Assessing this correlation and its use in future trend analysis is at the analyst's discretion.
The coefficient of determination shows the degree of correlation between a dependent variable and an independent variable. It is also called r² or r-squared. The value should be between 0.0 and 1.0. The closer it is to 0.0, the smaller the correlation of the dependent variable; the closer it is to 1.0, the greater the correlation. [1]
In regression, r-squared tells you whether there is a dependence between two values, and how much one value depends on the other.
The coefficient of determination cannot be greater than 1 because the formula always returns a number between 0.0 and 1.0. Anything above or below these numbers indicates an error. [1]
The coefficient of determination is a ratio that shows how dependent one variable is on another variable. Investors use it to determine the correlation between asset price movements and the index for which it is listed.
When an asset's r² is closer to zero, it indicates that its price movements are not dependent on the index. If its r² is closer to 1.0, it indicates that it is more dependent on the index's price movements.
[1] Pennsylvania State University Eberly College of Science. "STAT 462 Applied Regression Analysis: 2.5 - The Coefficient of Determination, r-squared."
[2] LibreTexts Statistics. "10.6: The Coefficient of Determination."
[3] Nasdaq. "APPL Historical Data."
[4] Nasdaq. "SPX Historical Data."
TheQuantHackers is a cutting-edge community composed of a group of people from the world's top universities and quantitative finance practitioners, dedicated to exploring the infinite possibilities in the fields of artificial intelligence (AI) and quantification (Quant). Our team members come from world-renowned universities such as the University of Cambridge, Oxford University, Harvard University, ETH Zurich, Peking University, and the University of Science and Technology of China. Our external consultants come from first-class companies such as Microsoft, HSBC, Citadel, Man Group, Citi, Jump Trading, and top domestic private equity companies.137.87 |19| 决定系数是一个统计学测量,用于检视一个变量的差异如何能被另一个变量的差异解释,特别是在预测特定事件结果时。这个系数更常被称为 r-squared(或 r²)。它评估了两个变量之间线性关系的强度,并在投资者进行趋势分析时被广泛依赖。
这个系数通常回答一个关键问题:如果某支股票在一个指数中上市且经历价格波动,那么其价格波动中有多少百分比是由该指数的价格波动引起的?
决定系数是一种测量,用于解释一个因素的变异性有多少是由于其与另一个因素的关系造成的。这种相关性用 0.0 到 1.0 或 0% 到 100% 的值表示。
1.0 的值表明 100% 的价格相关性,是未来预测的可靠模型。0.0 的值则暗示该模型显示价格不依赖于指数。[1]
0.20 的值表明 20% 的资产价格波动可以用指数来解释;0.50 的值则指示 50% 的价格波动可以被解释。
重要提示: 决定系数是相关系数的平方,相关系数在统计学中通常用 "r" 表示。值 "r" 可以是负数,但 r² 不能是负数,因为 r-squared 是 "r" 自乘的结果,平方的负数始终是正值。[2]
计算决定系数的方式是创建数据的散点图和趋势线。
如果您要绘制 S&P 500 和苹果(AAPL)股票的收盘价格,从12月21日到1月20日的交易日,您将收集如下表中的价格。[3]4
| S&P 日收盘 | APPL 日收盘 | |
|---|---|---|
| 1月20 | $3,928.86 | $135.21 |
| 17 | $3,990.97 | $137.87 |
| 19 | $3,999.09 | $134.76 |
| 12 | $3,983.17 | $135.27 |
| 18 | $3,969.61 | $133.49 |
| 10 | $3,919.25 | $135.21 |
| 17 | $3,892.09 | $130.15 |
| 6 | $3,895.08 | $135.94 |
| 13 | $3,808.10 | $125.02 |
| 4 | $3,852.97 | $134.76 |
| 12 | $3,824.14 | $125.07 |
| 12月30 | $3,839.50 | $133.41 |
| 11 | $3,849.28 | $129.61 |
| 28 | $3,783.22 | $133.49 |
| 10 | $3,829.25 | $130.03 |
| 23 | $3,844.82 | $130.73 |
| 9 | $3,822.39 | $132.23 |
| 21 | $3,878.44 | $130.15 |
| 6 | $3,972.61 | $15,781,630.21 |
| 5 | $547,703.74 | |
| 19 | $3,898.85 | $15,201,031.32 |
| 4 | $18,297.97 | $527,397.44 |
| 18 | $3,928.86 | $126.36 |
| 3 | $135.21 | $18,281.74 |
| 17 | $125.07 | |
| 12月30 | $15,927,841.54 | $135.94 |
| 29 | $3,999.09 | $15,992,720.83 |
| 28 | $538,917.37 | |
| 12 | $3,983.17 | $15,865,643.25 |
| 27 | $17,798.23 | $531,394.71 |
| 11 | $3,969.61 | $130.03 |
| 23 | $133.49 | $17,819.58 |
| 10 | $131.86 | |
| 22 | $15,360,520.56 | $130.73 |
| 21 | $3,892.09 | $15,148,364.57 |
接下来,您将创建一个散点图。数据与回归模型的拟合程度被称为拟合优度,它衡量趋势线与图中散布所有数据点之间的距离。
大多数电子表格使用相同的公式来计算数据集的 r²。如果数据位于您的表格的 A 列和 B 列中:
使用该公式并突出显示对应的单元格以获取 S&P 500 和苹果价格的 r² 为 0.347,这表明这两者的相关性较低,而如果 r² 在 0.5 和 1.0 之间,则相关性更高。
手动计算决定系数涉及几个步骤。首先,收集上述表格中的数据,然后计算所需的所有数值,如下表所示:[4]
| x | x² | y | y² | xy | |
|---|---|---|---|---|---|
| 1月20 | $506,555.51 | ||||
| 6 | $3,895.08 | $15,171,648.21 | $15,781,630.21 | $16,801.34 | $504,880.27 |
| 5 | $3,808.10 | $19,008.14 | $125.02 | $15,630.00 | $476,088.66 |
| 4 | $3,898.85 | $14,845,377.82 | $126.36 | $15,966.85 | $135.27 |
| 18 | $478,285.19 | ||||
| 12月30 | $3,839.50 | $14,741,760.25 | $15,435,940.90 | $19,580.40 | $537,261.24 |
| 29 | $3,849.28 | $18,281.74 | $129.61 | $16,798.75 | $498,905.18 |
| 28 | $3,990.97 | $14,312,753.57 | $126.04 | $15,886.08 | $135.94 |
| 13 | $497,917.38 | ||||
| 23 | $3,844.82 | $14,782,640.83 | $15,992,720.83 | $17,387.06 | $506,977.97 |
| 22 | $3,822.39 | $18,160.26 | $132.23 | $17,484.77 | $505,434.63 |
| 21 | $3,983.17 | $15,042,296.83 | $135.45 | $18,346.70 | $133.41 |
| 11 |
其中 √ 表示括号内结果的平方根。
15,757,803.55|
现在将步骤二和三相乘,将步骤一除以结果,并平方它:
17,819.58|
Upgrade to unlock all institutional-grade algorithms, derivative pricing engines, factor backtesting frameworks, and live QuantLab execution.
Explore Membership Access
Pre-order · £490Quantitative analytics platform
Waitlist closed — signal locked. Pre-order TQH TERMINAL now at £490 with launch-day delivery.